/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package desarrollo;


import java.awt.*;


/**
 *
 * @author Lab
 */

public class dibujo extends Canvas {
private int x1,x2,y1,y2,clicks;
    public void paint(Graphics g){
if(clicks==1){
g.drawOval(x1-10, y1-10,20 ,20);
}
 else{
    g.drawOval(x2-10, y1-10, 20, 20);
    g.drawLine(x1, y1, x2, y2);
 }
}
  public void addpunto(int x,int y){
  clicks++;
  if(clicks==1){
      this.x1=y;
      this.y1=y;
  }
 else{
      this.x2=x;
      this.y2=y;
      clicks=0;
 }
  repaint();
  }

   

}
